<?php
use Mirage\Abstraction\AbstractModule;
use Mirage\Web;
use Mirage\Autoload;
/**
 * Description of FrontModule
 *
 * @author Bryan Salazar
 */
class FrontModule extends AbstractModule
{
    public function initialize() 
    {
        // secure cookie setcookie( name, value, expire, path, domain, secure, httponly);
//        setcookie( 'UserName', 'Bob', 0, '/forums', 'www.example.com', isset($_SERVER["HTTPS"]), true);
        
        $this->defaultController = 'Site';
        $routes = require_once Web::app()->getModulePath() . '/front/config/routes.php';
        $controllerPath = Web::app()->getModulePath() . '/front/controllers';
        $this->setRoutes($routes);
        $this->setControllerPath($controllerPath);
        $this->setErrorHandler('Error', 'error404');
        
        Autoload::directoryAutoload(array(
            __DIR__.'/components',
            __DIR__.'/forms',
            __DIR__.'/models'
        ));
//        \Mirage\Util\Debug::dump($_SERVER);
    }
    
    public function finalize() {
        
    }
}